﻿<!DOCTYPE html>
<html>
  <head>
    <meta charset="UTF-8">
    <title>找回密码</title>
    <meta name="viewport" content="maximum-scale=1.0,minimum-scale=1.0,user-scalable=0,width=device-width,initial-scale=1.0" />
    <meta name="format-detection" content="telephone=no,email=no,date=no,address=no">
    <link rel="stylesheet" type="text/css" href="{:_SKIN}/weixin/shop/css/reset.css" />
    <link rel="stylesheet" type="text/css" href="{:_SKIN}/weixin/shop/css/zhuce.css" />
  <link rel="stylesheet" href="//cdn.bootcss.com/weui/1.1.1/style/weui.min.css">
<link rel="stylesheet" href="//cdn.bootcss.com/jquery-weui/1.0.1/css/jquery-weui.min.css">
<style type="text/css">
  
input { font-size: 20px }

</style>
  </head>
  <body>
    <div class="content">
      <!--头像-->
      <div class="touxiang">
        <img src="{:_SKIN}/weixin/my/pic/p1.png" width="50%"; style="border-radius: 200px" />
      </div>
      <!--表单-->
      <div class="biaodan" id="zc">
        <form action="">
          <div style="text-align: center;margin-bottom: 40px;">
            <button class="denglu">找回密码</button>
          </div>
          <div>
            <input type="text" id="tel" placeholder="请输入手机号码" class="in-1 zuo iput tel"  />
             <button class="btn zuo get_code" type="button" onclick="get_code()">获取验证码</button> 
          </div>
          <div>
            <input type="password" id="pwd" placeholder="请输入密码" class="in-3 iput" />
          </div>
          <div>
            <input type="password" id="pwd1" placeholder="请再次输入密码" class="in-3 iput"/>
          </div>

          <div>
            <input type="text" id="code" placeholder="请输入验证码" class="code in-1 iput"/>
          </div>
          
           <div class="fan">
            <a href="{:url('login')}" class="you" style="color: #B1B1B1;">返回登录</a>
          </div> 
          <div style="text-align: center;">
            <button type="button" class="xiugai" onclick="sub();">确认</button>
          </div>
        </form>
      </div>


      <div class="biaodan" style="display: none" id="done">
       
          
            <div style="text-align: center;">
            <button type="button" class="xiugai" onclick="window.location.href='{:Url('my/rz')}'">我是商家(进行开店认证)</button>
          </div>
          <div style="text-align: center;margin-top: 15px">
            <button type="button" class="xiugai" onclick="window.location.href='{:Url('my/index')}'">我是个人(去商城购物)</button>
          </div>
       
      </div>



      
      <!--底部-->
      <div class="dibu">
        <!-- <div style="width: 90%;margin: 0 auto;">
          <p class="disan zuo">微信一键登录</p>
        </div> -->
        <div class="disantu">
        <!--   <a href="{:url('weixin/my/index')}"><img src="{:_SKIN}/weixin/shop/img/weixin.png" width="14%"/></a> -->
        <!--  <a href="#"><img src="img/qq.png" width="14%"/></a>
          <a href="#"><img src="img/weibo.png" width="14%"/></a> -->
        </div>
      </div>
    </div>
  
    {:jq()}
    <script src="//cdn.bootcss.com/jquery-weui/1.0.1/js/jquery-weui.min.js"></script>

  
  <script>



  
  var d=true;
var time=60;
function d60(){
  console.log(time);
  if(d==false){ return false};

  $(".get_code").html(time);
   time--;

   if(time<1){
   
   $(".get_code").html("获取验证码");
    time=60;
 
    d=false;

   }
   setTimeout(function(){

    d60();
   },1000);
}


function get_code(type){

if(time!=60){ return false};

var data={
   tel:$(".tel").val()
   
}

if( !data.tel || data.tel.length!=11){

 $.alert('请输入正确的手机号');
  return false;
}



d60();
$.post("{:U('getcode')}",data,function(res){

 if(res.code==200){

  $.alert("发送成功");


 }else{

   $.alert(res.msg);
 }


});







}














     function sub(){


        var data={tel:$("#tel").val(),
                  pwd:$("#pwd").val(),
                  pwd1:$("#pwd1").val(),
                  code:$("#code").val() 
                  };

         if(data.tel.length!=11){


             $.alert('请输入正确的手机号码');
             return false;


         }

         if(data.pwd!=data.pwd1){

             $.alert('两次密码输入不一致');
             return false;

         }


          if(!data.pwd || !data.pwd1){

             $.alert('请输入密码');
             return false;

         }

         if(!data.code){

             $.alert('请输入验证码');
             return false;

         }




            $.showLoading('修改中');


         $.post(" ",data,function(res){
         

          if(res.code==200){
            $.hideLoading();
           $.toast('密码修改成功',function(){

           window.location.href="{:u('weixin/index/login')}";

           });


          }else{

          $.hideLoading();
          $.alert(res.msg);

          }

         });




     }



  </script>

  </body>
</html>
